from frontend.roleApplication import RoleApplication
from frontend.form import Type
from vars import *



class PackagePackagerApplication(RoleApplication):

    def __init__(self):
        super(PackagePackagerApplication, self).__init__(WorkflowName, Role.PackagePackager)
        # Here we use SINK step.  This lets the user choose a pre-existing record to work with from a queue on the left side
        self.register_transition_step(Step.PackageShipment, self.generic_middle_or_ending_role_form_creator, name_fields=['AddressName','PillowType','PillowQuantity'])
        
    def generic_middle_or_ending_role_form_creator(self, stepname, form):
        form.add_static_label('Packaging Form')
        #form.add_field(Type.SHORTSTRING, "SampleText", labeltext="Sample Text Field", initial="This is the default value!")
        form.add_task_label(fields=['PillowType','PillowQuantity'])
        form.add_field(Type.BOOLEAN, 'Packaged',labeltext="Items packaged", initial=False)
        form.add_field(Type.BOOLEAN, 'Shipped', labeltext="On truck for delivery", initial=False)
        

if __name__ == '__main__':
    app = PackagePackagerApplication()
    app.MainLoop()